package com.linwen.excise.niuke._40;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @author wlw
 * @date 2023/3/8 10:03 PM
 */
public class _29字符串加解密 {
    static Map<String,String> enMap = new HashMap<>();
    static Map<String,String> unEnMap = new HashMap<>();
    static{
        String[] key = new String[]{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"};
        String[] value = new String[]{"B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","a","1","2","3","4","5","6","7","8","9","0"};
        for (int i = 0; i < key.length; i++) {
            enMap.put(key[i],value[i]);
            unEnMap.put(value[i],key[i]);
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        String str2 = scanner.nextLine();

        System.out.println(function(str));
        System.out.println(function2(str2));


    }

    private static String function2(String str) {

        String[] strings = str.split("");
        StringBuilder stringBuilder = new StringBuilder();
        for (String string : strings) {
            stringBuilder.append(unEnMap.get(string));
        }
        return stringBuilder.toString();


    }

    private static String function(String str) {

        String[] strings = str.split("");
        StringBuilder stringBuilder = new StringBuilder();
        for (String string : strings) {
            stringBuilder.append(enMap.get(string));
        }
        return stringBuilder.toString();

    }
}
